package com.example.safeassistan.risk.adapter;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.safeassistan.R;
import com.example.safeassistan.home.adapter.HiddenDangerInvestigationChildAdapter;
import com.example.safeassistan.home.model.InvestigationModel;
import com.example.safeassistan.risk.model.RiskPointTableDetailModel;

import java.util.List;

public class RiskPointTableDetailListPAdapter extends BaseQuickAdapter<InvestigationModel.ResultDTO,BaseViewHolder> {
    public RiskPointTableDetailListPAdapter(@Nullable List<InvestigationModel.ResultDTO> data) {
        super(R.layout.item_checktable_investigationp, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, InvestigationModel.ResultDTO item) {
        helper.setText(R.id.tvTitle,item.getItemName());
        RecyclerView rcView=helper.getView(R.id.rcView);
        HiddenDangerInvestigationChildAdapter adapter=new HiddenDangerInvestigationChildAdapter(item.getChildren());
        rcView.setLayoutManager(new LinearLayoutManager(mContext));
        rcView.setAdapter(adapter);

    }
}